const getters = {
    userInfo: state => {
        let {score, validDays, achievements} = state.userInfo;
        let userInfo = {};
        userInfo.basicInfo = state.userInfo;
        userInfo.score = {
            icon: 'icon-01',
            title: '当前积分',
            leftEle: `${score}积分`,
            href: 'http://www.baidu.com'
        }

        userInfo.validDays = {
            icon: 'icon-02',
            title: '会员有效期',
            leftEle: `还剩${validDays}天`,
            href: ''
        }

        userInfo.achievements = {
            icon: 'icon-03',
            title: '我的成就',
            leftEle: '详情',
            href: '',
            data: [{
                bg: 'tile1',
                title: '使用IO健身天数',
                data: achievements ? achievements.useIODays : '',
                uni: '天'
            }, {
                bg: 'tile2',
                title: '上周完成课程',
                data: achievements ? achievements.completedCourses : '',
                uni: '节'
            }, {
                title: '上周锻炼时长',
                data: achievements ? achievements.exerciseTime : '',
                uni: '小时'
            }, {
                title: '上周燃脂',
                data: achievements ? achievements.calories : '',
                uni: 'KJ'
            }]
        }

        userInfo.health = {
            icon: 'icon-04',
            title: '健康档案',
            href: ''
        }

        userInfo.history = {
            icon: 'icon-02',
            title: '锻炼历史',
            href: ''
        }

        return userInfo;
    }
}
export default getters
